#include<iostream>
#include<string>
#include<vector>
using namespace std;
#include<algorithm>

class Solution {
public:
    bool uniqueOccurrences(vector<int>& arr) {
        sort(arr.begin(), arr.end());
        int num = arr[0];
        vector<int> sum;
        int t = 0;
        for (int i = 0; i < arr.size(); i++) {
            if (num == arr[i]) {
                t = t + 1;
            }
            else {
                for (int j = 0; j < sum.size(); j++) {
                    if (t == sum[j])
                    {
                        return false;
                    }
                }
                sum.push_back(t);
                num = arr[i];
                
                t = 1;
            }
        }
        for (int j = 0; j < sum.size(); j++) {
            if (t == sum[j])
            {
                return false;
            }
        }
        return true;

    }
};


//int main() {
//    Solution S;
//    vector<int> arr;
//    arr.insert(arr.begin(), { 1,2 });
//    cout << S.uniqueOccurrences(arr) << endl;;
//}